package com.demo.app;

import java.util.List;

import com.demo.crawler.Crawler;
import com.demo.download.Http;

public class App {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Crawler cr = new Crawler();
		Http http = new Http(10);
		List<String> Album = cr.parseHomePage("https://www.52shuku8.com/tuili/1117/hrES_2.html");
		System.out.println("====> 共获取" + Album.size() + "个页面链接");
		if (Album != null && Album.size() > 0) {
			for (int i = 0; i < Album.size(); i++) {
				String url = Album.get(i);
				System.out.println("===> 开始从：" + url + "，获取图片资源");
				List<String> urls = cr.parseAlbumPage(url);
				System.out.println("===> 从：" + url + "，获取到" + urls.size() + "个图片资源");
				http.downloads(urls, "E:\\pic");
			}
		}
	}

}
